﻿#ifndef CONTROLLER_H
#define CONTROLLER_H
#include "QList"
#include "QFile"
#include "QDebug"
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "QTableWidget"

class Controller
{
public:
    Controller();
    void readTxt();
    QList<QString> analysisData(QString str);
    int getLine();
    
    
private:
    int lines;
};

#endif // CONTROLLER_H




/*
 * @author  : Zeeland
 * @describe: 用于读取记事本中的字符串
 * @param   : QString str(一行的数据)
 * @return  : QList<QString>
 */
void Controller::readTxt()
{
    int count =0;
    QString displayString;
    QFile file("./Data/File/Text.txt");
    if(!file.open(QIODevice::ReadWrite)){
        qDebug()<<"打开失败";
    }
    else
    {
        qDebug()<<"打开成功";
        while(!file.atEnd())
        {
            QByteArray line = file.readLine();
            QString str(line);
            qDebug()<< str;
            analysisData(str);
            count++;
        }
           lines = count =0;
           file.close();
    }
}




/*
 * @author  : Zeeland
 * @describe: 解析记事本中一行的数据
 * @param   : QString str(一行的数据)
 * @return  : QList<QString>
 */
QList<QString> Controller::analysisData(QString str)
{
    
}

/*
 * @author  : Zeeland
 * @describe: 获取行数
 * @param   : QString str(一行的数据)
 * @return  : QList<QString>
 */
int Controller::getLine()
{
    return lines;
}


